import { messages } from "share/common";
import React, { Component } from "react";
import { Modal, Button } from "antd";
import "styles/contract/my-contract/contract-modal.scss";

class ContractModal extends Component {
  constructor(props) {
    super(props);
  }
  render() {
    const { isForce, onCancel, onOk, data, loading } = this.props;
    const jingData = data.filter((item) => item.type === 0);
    const jinZhiData = data.filter((item) => item.type === 1);
    return (
      <Modal
        {...this.props}
        className="check-modal"
        footer={
          <div>
            <Button key="back" type="button" onClick={onCancel}>
              {messages("common.back") /*返回*/}
            </Button>
            {isForce === 0 ? (
              <Button key="submit" type="primary" onClick={onOk}>
                {messages("finance-6.key151") /*继续提交*/}
              </Button>
            ) : null}
          </div>
        }
      >
        {
          <div className="check-content">
            <p className="content-title">{messages("finance-6.key152") /*总金额超申请*/}</p>
            {isForce === 0
              ? (jingData || []).map((item, index) => (
                  <p key={index} className="content jing-content">
                    {item.result}
                  </p>
                ))
              : (jinZhiData || []).map((item, index) => (
                  <p key={index} className="content jin-content">
                    {item.result}
                  </p>
                ))}
          </div>
        }
      </Modal>
    );
  }
}
export default ContractModal;
